﻿//
// Decompiled with: Decompiler.NET, Version=1.3.1.18439, Culture=neutral, PublicKeyToken=null, Version: 1.3.1.18439
// Decompilation Started at: 3/15/2009 10:34:26 PM
// Copyright 2003 - 2004, Jungle Creatures, Inc., All Rights Reserved. 
// Written by Jonathan Pierce, Email: support@junglecreatures.com
//

namespace PatientManagement

{
		
		#region Namespace Import Declarations
		
			using System.Collections;
			using System.ComponentModel;
			using System.Data.Common;
			using System.Data;
			using System.Data.SqlClient;
			using System.Drawing;
			using System;
			using System.Resources;
			using System.Windows.Forms;
			using Utility;
			
		#endregion
		
	public class frmLapHoaDonYTa : Form
	
	{
		
		#region Fields
			public string BacSi;
			private Button btExit;
			private Button btThanhTien;
			public string ChanDoan;
			public string clrISN;
			private Container components;
			private string connStr;
			private Database_Com db;
			public string DiaChi;
			public int flag;
			public string ID;
			private Label label1;
			private Label label2;
			private Label label3;
			private Label label4;
			private Label label5;
			private Label label6;
			private Label label7;
			private Label label8;
			private Label lbBenhNhan;
			private Label lbID;
			public string LoiDan;
			public string NgayKham;
			public string NgayTaiKham;
			public string NgheNghiep;
			private string patID;
			private string patName;
			public string Phai;
			private long result;
			private long resultBalance;
			public string SumPaid;
			private TextBox tbTienKham;
			private TextBox tbTienThuoc;
			private TextBox tbTienThuThuat;
			private TextBox tbTongCong;
			public string Ten;
			public string ThuocSuDung;
			public string ThuThuat;
			public string TienKham;
			public string TienThuoc;
			public string TienThuThuat;
			public string TongCong;
			public string Tuoi;
			private TextBox txtPhauThuat;
		#endregion
		
		#region Constructors
		
			public frmLapHoaDonYTa (string _patID, string _patName, string _clrISN)
			
			{
				this.components = ((System.ComponentModel.Container) null);
				this.flag = 1;
				this.db = new Database_Com ();
				this.resultBalance = 0L;
				this.patID = _patID;
				this.patName = _patName;
				this.clrISN = _clrISN;
				this.InitializeComponent ();
				this.connStr = Connection.ConnectionString ();
				return;
			}
			
		#endregion
		
		#region Methods
		
			private void btExit_Click (object sender, EventArgs e)
			
			{
				base.Close ();
				return;
			}
			
			private void btThanhTien_Click (object sender, EventArgs e)
			
			{
				SqlConnection theSqlConnection;
				SqlCommand theSqlCommand;
				string theString;
				DataSet theDataSet;
				string theString2;
				SqlCommand theSqlCommand2;
				SqlParameter theSqlParameter;
				Exception theException;
				object[] theObjectArray;
				string[] theStringArray;
				if (! this.check ())
				{
					goto L_02F1;
				}
				if (this.tbTienThuThuat.ReadOnly)
				{
					goto L_004A;
				}
				if (Convert.ToInt64 (this.parseString (this.tbTienThuThuat.Text)) != ((long) 0))
				{
					goto L_004A;
				}
				DialogResult theDialogResult = MessageBox.Show ("Vui lòng nhập tiền thuốc lớn hơn 0!", "Lỗi Nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_02F1;
				
			L_004A:
				
				{
				}
				if (this.txtPhauThuat.ReadOnly)
				{
					goto L_0089;
				}
				if (Convert.ToInt64 (this.parseString (this.txtPhauThuat.Text)) != ((long) 0))
				{
					goto L_0089;
				}
				DialogResult theDialogResult2 = MessageBox.Show ("Vui lòng nhập tiền phẫu thuật lớn 0!", "Lỗi Nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_02F1;
				
			L_0089:
				
				{
				}
				if (this.tbTongCong.Text != "")
				{
					goto L_00A8;
				}
				this.tbTienPhauThuat_Leave (sender, e);
				
			L_00A8:
				try
				{
					theSqlConnection = new SqlConnection (this.connStr);
					theObjectArray = new object[13];
					theObjectArray[0] = "INSERT INTO Invoices VALUES (";
					theObjectArray[1] = this.clrISN;
					theObjectArray[2] = ", ";
					theObjectArray[3] = this.parseString (this.tbTienKham.Text);
					theObjectArray[4] = ", ";
					theObjectArray[5] = this.parseString (this.tbTienThuoc.Text);
					theObjectArray[6] = ", ";
					theObjectArray[7] = this.parseString (this.tbTienThuThuat.Text);
					theObjectArray[8] = ", ";
					theObjectArray[9] = this.parseString (this.txtPhauThuat.Text);
					theObjectArray[10] = ", ";
					theObjectArray[11] = this.result;
					theObjectArray[12] = ",\'0\')";
					theSqlCommand = new SqlCommand (string.Concat (theObjectArray), theSqlConnection);
					theSqlCommand.Connection.Open ();
					int i = theSqlCommand.ExecuteNonQuery ();
					theSqlCommand.Connection.Close ();
					this.SumPaid = this.result.ToString ();
					DialogResult theDialogResult3 = MessageBox.Show ("Hóa đơn đã được lưu", "Nhập thành công", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					SqlConnection theSqlConnection2 = this.db.CreateConnections ();
					theString = Class.isn;
					theDataSet = this.db.Exc_Query ("select max(invISN) from Invoices");
					theString2 = theDataSet.Tables[0].Rows[0][0].ToString ();
					theStringArray = new string[7];
					theStringArray[0] = "Insert UserUpdatedInvoices values(";
					theStringArray[1] = theString;
					theStringArray[2] = ",";
					theStringArray[3] = theString2;
					theStringArray[4] = ",getDate(),@lido,1,0,";
					theStringArray[5] = this.clrISN;
					theStringArray[6] = ")";
					theSqlCommand2 = new SqlCommand (string.Concat (theStringArray), theSqlConnection);
					theSqlParameter = new SqlParameter ("@lido", SqlDbType.NVarChar);
					theSqlParameter.Value = "Nhập hóa đơn";
					SqlParameter theSqlParameter2 = theSqlCommand2.Parameters.Add (theSqlParameter);
					theSqlCommand2.Connection.Open ();
					int i2 = theSqlCommand2.ExecuteNonQuery ();
					theSqlCommand2.Connection.Close ();
					UserInformation.rowUpdated = true;
				}
				catch (Exception theException2)
				{
					
				L_02A4:
					theException = theException2;
					DialogResult theDialogResult4 = MessageBox.Show (theException.Message);
				}
				
			L_02B5:
				
				{
				}
				this.btThanhTien.Enabled = false;
				this.tbTienKham.Enabled = false;
				this.tbTienThuoc.Enabled = false;
				this.tbTienThuThuat.Enabled = false;
				this.txtPhauThuat.Enabled = false;
				
			L_02F1:
				return;
			}
			
			private bool check ()
			
			{
				bool theBoolean;
				if (this.tbTienKham.Text != "")
				{
					goto L_0031;
				}
				DialogResult theDialogResult = MessageBox.Show ("Vui lòng nhập tiền khám!", "Lỗi nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				theBoolean = false;
				goto L_0181;
				
			L_0031:
				
				{
				}
				if (this.tbTienThuoc.Text != "")
				{
					goto L_0062;
				}
				DialogResult theDialogResult2 = MessageBox.Show ("Vui lòng nhập tiền thuốc !", "Lỗi nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				theBoolean = false;
				goto L_0181;
				
			L_0062:
				
				{
				}
				if (this.IsNumber (this.parseString (this.tbTienKham.Text)))
				{
					goto L_00B1;
				}
				DialogResult theDialogResult3 = MessageBox.Show ("Vui lòng nhập kiểu số cho tiền khám !", "Lỗi nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				this.tbTienKham.Text = "";
				bool theBoolean2 = this.tbTienKham.Focus ();
				theBoolean = false;
				goto L_0181;
				
			L_00B1:
				
				{
				}
				if (this.IsNumber (this.parseString (this.tbTienThuoc.Text)))
				{
					goto L_0100;
				}
				DialogResult theDialogResult4 = MessageBox.Show ("Vui lòng nhập kiểu số cho tiền thuốc !", "Lỗi nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				this.tbTienThuoc.Text = "";
				bool theBoolean3 = this.tbTienThuoc.Focus ();
				theBoolean = false;
				goto L_0181;
				
			L_0100:
				
				{
				}
				if (this.IsNumber (this.parseString (this.tbTienThuThuat.Text)))
				{
					goto L_014C;
				}
				DialogResult theDialogResult5 = MessageBox.Show ("Vui lòng nhập kiểu số cho tiền thủ thuật !", "Lỗi nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				this.tbTienThuThuat.Text = "0";
				bool theBoolean4 = this.tbTienThuThuat.Focus ();
				theBoolean = false;
				goto L_0181;
				
			L_014C:
				
				{
				}
				if (Convert.ToInt64 (this.parseString (this.tbTienKham.Text)) != ((long) 0))
				{
					goto L_017D;
				}
				DialogResult theDialogResult6 = MessageBox.Show ("Vui lòng nhập tiền khám lớn hơn 0!", "Lỗi nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				theBoolean = false;
				goto L_0181;
				
			L_017D:
				
				{
				}
				theBoolean = true;
				goto L_0181;
				
			L_0181:
				
				{
				}
				return theBoolean;
			}
			
			protected override void Dispose (bool disposing)
			
			{
				this.flag = 0;
				if (! disposing)
				{
					goto L_001D;
				}
				if (this.components == null)
				{
					goto L_001D;
				}
				this.components.Dispose ();
				
			L_001D:
				
				{
				}
				base.Dispose (disposing);
				return;
			}
			
			private void frmLapHoaDonYTa_Load (object sender, EventArgs e)
			
			{
				SqlDataAdapter theSqlDataAdapter;
				DataSet theDataSet;
				UserInformation.rowUpdated = false;
				this.lbID.Text = this.patID;
				this.lbBenhNhan.Text = this.patName;
				
			L_0028:
				try
				{
					theSqlDataAdapter = new SqlDataAdapter (string.Concat ("select clrSkill,clrSurgery,HasPrescription from vw_CalculateInvoices where clrIS"
					+ "N = ", this.clrISN), this.connStr);
					theDataSet = new DataSet ();
					int i = theSqlDataAdapter.Fill (theDataSet);
					theSqlDataAdapter.Dispose ();
					if (theDataSet.Tables[0].Rows[0][0].ToString () != string.Empty)
					{
						goto L_00A2;
					}
					this.tbTienThuThuat.Text = "0";
					this.tbTienThuThuat.ReadOnly = true;
					
				L_00A2:
					
					{
					}
					if (theDataSet.Tables[0].Rows[0][1].ToString () != string.Empty)
					{
						goto L_00EC;
					}
					this.txtPhauThuat.Text = "0";
					this.txtPhauThuat.ReadOnly = true;
					
				L_00EC:
					
					{
					}
					if (theDataSet.Tables[0].Rows[0][2].ToString () != "0")
					{
						goto L_0136;
					}
					this.tbTienThuoc.Text = "0";
					this.tbTienThuoc.ReadOnly = true;
					
				L_0136:
					
					{
					}
				}
				catch
				{
					
				L_0138:
					
					{
					}
					this.tbTienThuThuat.Text = "0";
					this.tbTienThuThuat.ReadOnly = true;
					this.txtPhauThuat.Text = "0";
					this.txtPhauThuat.ReadOnly = true;
					this.tbTienThuoc.Text = "0";
					this.tbTienThuoc.ReadOnly = true;
				}
				
			L_018F:
				return;
			}
			
			private void ID_Validate (object sender, KeyPressEventArgs e)
			
			{
				if (char.IsNumber (e.KeyChar))
				{
					goto L_0027;
				}
				if (e.KeyChar == '\u0008')
				{
					goto L_0027;
				}
				if (e.KeyChar == '\r')
				{
					goto L_0027;
				}
				e.Handled = true;
				
			L_0027:
				
				{
				}
				goto L_0029;
				
			L_0029:
				return;
			}
			
			private void ID_ValidateTong (object sender, KeyPressEventArgs e)
			
			{
				e.Handled = true;
				return;
			}
			
			private void InitializeComponent ()
			
			{
				ResourceManager theResourceManager;
				Control[] theControlArray;
				theResourceManager = new ResourceManager (typeof (frmLapHoaDonYTa));
				this.label7 = new Label ();
				this.lbID = new Label ();
				this.btThanhTien = new Button ();
				this.tbTongCong = new TextBox ();
				this.tbTienThuThuat = new TextBox ();
				this.tbTienThuoc = new TextBox ();
				this.tbTienKham = new TextBox ();
				this.label6 = new Label ();
				this.label5 = new Label ();
				this.label4 = new Label ();
				this.label3 = new Label ();
				this.label2 = new Label ();
				this.label1 = new Label ();
				this.lbBenhNhan = new Label ();
				this.txtPhauThuat = new TextBox ();
				this.label8 = new Label ();
				this.btExit = new Button ();
				base.SuspendLayout ();
				this.label7.Font = new System.Drawing.Font ("Verdana", 12F, FontStyle.Bold, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label7.ForeColor = Color.MediumBlue;
				this.label7.Location = new Point (176, 20);
				this.label7.Name = "label7";
				this.label7.Size = new System.Drawing.Size (109, 23);
				this.label7.TabIndex = 30;
				this.label7.Text = "Hóa Đơn";
				this.lbID.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Bold, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.lbID.ForeColor = Color.Black;
				this.lbID.Location = new Point (112, 68);
				this.lbID.Name = "lbID";
				this.lbID.Size = new System.Drawing.Size (292, 23);
				this.lbID.TabIndex = 8;
				this.btThanhTien.FlatStyle = FlatStyle.Popup;
				this.btThanhTien.Location = new Point (170, 258);
				this.btThanhTien.Name = "btThanhTien";
				this.btThanhTien.Size = new System.Drawing.Size (78, 23);
				this.btThanhTien.TabIndex = 16;
				this.btThanhTien.Text = "Lưu";
				this.btThanhTien.Click += new EventHandler (this.btThanhTien_Click);
				this.tbTongCong.BorderStyle = BorderStyle.FixedSingle;
				this.tbTongCong.Font = new System.Drawing.Font ("Verdana", 12F, FontStyle.Bold, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.tbTongCong.ForeColor = Color.Blue;
				this.tbTongCong.Location = new Point (170, 224);
				this.tbTongCong.Name = "tbTongCong";
				this.tbTongCong.Size = new System.Drawing.Size (180, 27);
				this.tbTongCong.TabIndex = 14;
				this.tbTongCong.Text = "";
				this.tbTongCong.KeyPress += new KeyPressEventHandler (this.ID_ValidateTong);
				this.tbTienThuThuat.BorderStyle = BorderStyle.FixedSingle;
				this.tbTienThuThuat.Location = new Point (170, 172);
				this.tbTienThuThuat.Name = "tbTienThuThuat";
				this.tbTienThuThuat.Size = new System.Drawing.Size (180, 22);
				this.tbTienThuThuat.TabIndex = 12;
				this.tbTienThuThuat.Text = "";
				this.tbTienThuThuat.KeyPress += new KeyPressEventHandler (this.ID_Validate);
				this.tbTienThuThuat.Leave += new EventHandler (this.tbTienThuThuat_Leave);
				this.tbTienThuoc.BorderStyle = BorderStyle.FixedSingle;
				this.tbTienThuoc.Location = new Point (170, 148);
				this.tbTienThuoc.Name = "tbTienThuoc";
				this.tbTienThuoc.Size = new System.Drawing.Size (180, 22);
				this.tbTienThuoc.TabIndex = 11;
				this.tbTienThuoc.Text = "";
				this.tbTienThuoc.KeyPress += new KeyPressEventHandler (this.ID_Validate);
				this.tbTienThuoc.Leave += new EventHandler (this.tbTienThuoc_Leave);
				this.tbTienKham.BorderStyle = BorderStyle.FixedSingle;
				this.tbTienKham.Location = new Point (170, 124);
				this.tbTienKham.Name = "tbTienKham";
				this.tbTienKham.Size = new System.Drawing.Size (180, 22);
				this.tbTienKham.TabIndex = 10;
				this.tbTienKham.Text = "";
				this.tbTienKham.KeyPress += new KeyPressEventHandler (this.ID_Validate);
				this.tbTienKham.Leave += new EventHandler (this.tbTienKham_Leave);
				this.label6.Location = new Point (26, 228);
				this.label6.Name = "label6";
				this.label6.Size = new System.Drawing.Size (125, 16);
				this.label6.TabIndex = 6;
				this.label6.Text = "Tổng Cộng:";
				this.label5.Location = new Point (26, 177);
				this.label5.Name = "label5";
				this.label5.Size = new System.Drawing.Size (125, 16);
				this.label5.TabIndex = 4;
				this.label5.Text = "Tiền thủ thuật:";
				this.label4.Location = new Point (26, 151);
				this.label4.Name = "label4";
				this.label4.Size = new System.Drawing.Size (125, 12);
				this.label4.TabIndex = 3;
				this.label4.Text = "Tiền thuốc:";
				this.label3.Location = new Point (26, 129);
				this.label3.Name = "label3";
				this.label3.Size = new System.Drawing.Size (125, 12);
				this.label3.TabIndex = 2;
				this.label3.Text = "Tiền khám:";
				this.label2.Font = new System.Drawing.Font ("Verdana", 9F, FontStyle.Bold, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label2.Location = new Point (26, 101);
				this.label2.Name = "label2";
				this.label2.Size = new System.Drawing.Size (86, 24);
				this.label2.TabIndex = 2;
				this.label2.Text = "Bệnh nhân:";
				this.label1.Font = new System.Drawing.Font ("Verdana", 9F, FontStyle.Bold, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label1.Location = new Point (26, 68);
				this.label1.Name = "label1";
				this.label1.Size = new System.Drawing.Size (54, 23);
				this.label1.TabIndex = 1;
				this.label1.Text = "Số ID:";
				this.lbBenhNhan.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Bold, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.lbBenhNhan.ForeColor = Color.Black;
				this.lbBenhNhan.Location = new Point (112, 101);
				this.lbBenhNhan.Name = "lbBenhNhan";
				this.lbBenhNhan.Size = new System.Drawing.Size (292, 24);
				this.lbBenhNhan.TabIndex = 9;
				this.txtPhauThuat.BorderStyle = BorderStyle.FixedSingle;
				this.txtPhauThuat.Location = new Point (170, 197);
				this.txtPhauThuat.Name = "txtPhauThuat";
				this.txtPhauThuat.Size = new System.Drawing.Size (180, 22);
				this.txtPhauThuat.TabIndex = 13;
				this.txtPhauThuat.Text = "";
				this.txtPhauThuat.KeyPress += new KeyPressEventHandler (this.ID_Validate);
				this.txtPhauThuat.Leave += new EventHandler (this.tbTienPhauThuat_Leave);
				this.label8.Location = new Point (26, 201);
				this.label8.Name = "label8";
				this.label8.Size = new System.Drawing.Size (125, 17);
				this.label8.TabIndex = 5;
				this.label8.Text = "Tiền phẫu thuật:";
				this.btExit.FlatStyle = FlatStyle.Popup;
				this.btExit.Location = new Point (256, 258);
				this.btExit.Name = "btExit";
				this.btExit.Size = new System.Drawing.Size (88, 23);
				this.btExit.TabIndex = 21;
				this.btExit.Text = "Thoát";
				this.btExit.Click += new EventHandler (this.btExit_Click);
				this.AutoScaleBaseSize = new System.Drawing.Size (7, 15);
				base.ClientSize = new System.Drawing.Size (410, 296);
				theControlArray = new Control[17];
				theControlArray[0] = ((Control) this.btExit);
				theControlArray[1] = ((Control) this.txtPhauThuat);
				theControlArray[2] = ((Control) this.label8);
				theControlArray[3] = ((Control) this.label7);
				theControlArray[4] = ((Control) this.lbID);
				theControlArray[5] = ((Control) this.tbTongCong);
				theControlArray[6] = ((Control) this.tbTienThuThuat);
				theControlArray[7] = ((Control) this.tbTienThuoc);
				theControlArray[8] = ((Control) this.tbTienKham);
				theControlArray[9] = ((Control) this.label6);
				theControlArray[10] = ((Control) this.label5);
				theControlArray[11] = ((Control) this.label4);
				theControlArray[12] = ((Control) this.label3);
				theControlArray[13] = ((Control) this.label2);
				theControlArray[14] = ((Control) this.label1);
				theControlArray[15] = ((Control) this.lbBenhNhan);
				theControlArray[16] = ((Control) this.btThanhTien);
				base.Controls.AddRange (theControlArray);
				this.Font = new System.Drawing.Font ("Verdana", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
				base.Icon = ((System.Drawing.Icon) theResourceManager.GetObject ("$this.Icon"));
				base.MaximizeBox = false;
				base.MinimizeBox = false;
				base.Name = "frmLapHoaDonYTa";
				base.StartPosition = FormStartPosition.CenterScreen;
				this.Text = "Hóa Đơn";
				base.SizeChanged += new EventHandler (this.frmLapHoaDonYTa_Load);
				base.Load += new EventHandler (this.frmLapHoaDonYTa_Load);
				base.ResumeLayout (false);
				return;
			}
			
			public bool IsNumber (string text)
			
			{
				bool theBoolean;
				
			L_0000:
				try
				{
					long theLong = Convert.ToInt64 (text);
					theBoolean = true;
				}
				catch
				{
					
				L_000B:
					
					{
					}
					theBoolean = false;
				}
				
			L_0010:
				
				{
				}
				return theBoolean;
			}
			
			public string parseString (string Tien)
			
			{
				string theString;
				ArrayList theArrayList;
				string theString2;
				int i;
				string theString3;
				string[] theStringArray;
				char[] theCharArray;
				int i2;
				theString = string.Empty;
				theArrayList = new ArrayList ();
				theCharArray = new char[1];
				theCharArray[0] = '\u002E';
				theStringArray = Tien.Split (theCharArray);
				i2 = 0;
				goto L_003D;
				
			L_0029:
				
				{
				}
				theString2 = theStringArray[i2];
				int i3 = theArrayList.Add (theString2);
				i2++;
				
			L_003D:
				
				{
				}
				if (i2 < theStringArray.Length)
				{
					goto L_0029;
				}
				i = 0;
				goto L_0060;
				
			L_0049:
				
				{
				}
				theString = string.Concat (theString, theArrayList[i].ToString ());
				i++;
				
			L_0060:
				
				{
				}
				if (i < theArrayList.Count)
				{
					goto L_0049;
				}
				theString3 = theString;
				goto L_006E;
				
			L_006E:
				
				{
				}
				return theString3;
			}
			
			public string parseTien (string tien)
			
			{
				ArrayList theArrayList;
				int i;
				char[] theCharArray;
				ArrayList theArrayList2;
				int i2;
				int i3;
				int i4;
				string theString;
				int i5;
				string theString2;
				theArrayList = new ArrayList ();
				i = 3;
				goto L_001C;
				
			L_000A:
				
				{
				}
				int i6 = theArrayList.Add (i.ToString ());
				i += 3;
				
			L_001C:
				
				{
				}
				if (i < 100)
				{
					goto L_000A;
				}
				theCharArray = tien.ToCharArray ();
				theArrayList2 = new ArrayList ();
				i2 = 1;
				i3 = theCharArray.Length;
				goto L_009B;
				
			L_0038:
				
				{
				}
				int i7 = theArrayList2.Add (theCharArray[(i3 - 1)].ToString ());
				i4 = 0;
				goto L_0085;
				
			L_0053:
				
				{
				}
				if (theArrayList[i4].ToString () != i2.ToString ())
				{
					goto L_007F;
				}
				if (i3 <= 1)
				{
					goto L_007F;
				}
				int i8 = theArrayList2.Add (".");
				
			L_007F:
				
				{
				}
				i4++;
				
			L_0085:
				
				{
				}
				if (i4 < theArrayList.Count)
				{
					goto L_0053;
				}
				i2++;
				i3--;
				
			L_009B:
				
				{
				}
				if ((i3 <= theCharArray.Length) && (i3 > 0))
				{
					goto L_0038;
				}
				
			L_00A7:
				
				{
				}
				theString = string.Empty;
				i5 = theArrayList2.Count;
				goto L_00D6;
				
			L_00B8:
				
				{
				}
				theString = string.Concat (theString, theArrayList2[((int) (i5 - 1))].ToString ());
				i5--;
				
			L_00D6:
				
				{
				}
				if (i5 > theArrayList2.Count)
				{
					goto L_00E5;
				}
				if (i5 > 0)
				{
					goto L_00B8;
				}
				
			L_00E5:
				
				{
				}
				theString2 = theString;
				goto L_00EB;
				
			L_00EB:
				
				{
				}
				return theString2;
			}
			
			private void tbTienKham_Leave (object sender, EventArgs e)
			
			{
				this.tbTienKham.Text = this.parseString (this.tbTienKham.Text);
				this.tbTienKham.Text = this.parseTien (this.tbTienKham.Text);
				return;
			}
			
			private void tbTienPhauThuat_Leave (object sender, EventArgs e)
			
			{
				if (this.IsNumber (this.parseString (this.txtPhauThuat.Text)))
				{
					goto L_004D;
				}
				DialogResult theDialogResult = MessageBox.Show ("Vui lòng nhập kiểu số cho tiền phẫu thuật !", "Lỗi nhập", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				this.txtPhauThuat.Text = "0";
				bool theBoolean = this.txtPhauThuat.Focus ();
				goto L_02F2;
				
			L_004D:
				
				{
				}
				this.txtPhauThuat.Text = this.parseString (this.txtPhauThuat.Text);
				this.txtPhauThuat.Text = this.parseTien (this.txtPhauThuat.Text);
				if (! this.check ())
				{
					goto L_02F2;
				}
				if (this.txtPhauThuat.Text != "")
				{
					goto L_0135;
				}
				if (this.tbTienThuThuat.Text != "")
				{
					goto L_0135;
				}
				this.txtPhauThuat.Text = "0";
				this.tbTienThuThuat.Text = "0";
				this.tbTongCong.Text = this.parseTien ((this.result = (Convert.ToInt64 (this.parseString (this.tbTienKham.Text)) + Convert.ToInt64 (this.parseString (this.tbTienThuoc.Text)))).ToString ());
				goto L_02F2;
				
			L_0135:
				
				{
				}
				if (this.tbTienThuThuat.Text != "")
				{
					goto L_01CF;
				}
				this.tbTienThuThuat.Text = "0";
				this.tbTongCong.Text = this.parseTien ((this.result = ((Convert.ToInt64 (this.parseString (this.tbTienKham.Text)) + Convert.ToInt64 (this.parseString (this.tbTienThuoc.Text))) + Convert.ToInt64 (this.parseString (this.txtPhauThuat.Text.ToString ())))).ToString ());
				goto L_02F2;
				
			L_01CF:
				
				{
				}
				if (this.txtPhauThuat.Text != "")
				{
					goto L_0269;
				}
				this.txtPhauThuat.Text = "0";
				this.tbTongCong.Text = this.parseTien ((this.result = ((Convert.ToInt64 (this.parseString (this.tbTienKham.Text)) + Convert.ToInt64 (this.parseString (this.tbTienThuoc.Text))) + Convert.ToInt64 (this.parseString (this.tbTienThuThuat.Text.ToString ())))).ToString ());
				goto L_02F2;
				
			L_0269:
				
				{
				}
				this.tbTongCong.Text = this.parseTien ((this.result = (((Convert.ToInt64 (this.parseString (this.tbTienKham.Text)) + Convert.ToInt64 (this.parseString (this.tbTienThuoc.Text))) + Convert.ToInt64 (this.parseString (this.tbTienThuThuat.Text.ToString ()))) + Convert.ToInt64 (this.parseString (this.txtPhauThuat.Text.ToString ())))).ToString ());
				goto L_02F2;
				
			L_02F2:
				return;
			}
			
			private void tbTienThuoc_Leave (object sender, EventArgs e)
			
			{
				this.tbTienThuoc.Text = this.parseString (this.tbTienThuoc.Text);
				this.tbTienThuoc.Text = this.parseTien (this.tbTienThuoc.Text);
				return;
			}
			
			private void tbTienThuThuat_Leave (object sender, EventArgs e)
			
			{
				this.tbTienThuThuat.Text = this.parseString (this.tbTienThuThuat.Text);
				this.tbTienThuThuat.Text = this.parseTien (this.tbTienThuThuat.Text);
				return;
			}
			
		#endregion
	}
	
}

